﻿<div v-if="vmorder.totals != null" class="total-info table-responsive px-0">
    <table class="table table-hover">
        <tbody>
        <tr class="col-12 px-0 order-subtotal d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.SubTotal"]:</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{vmorder.totals.SubTotal}}</span>
            </td>
        </tr>
        <tr v-if="vmorder.totals.SubTotalDiscount !== null" class="col-12 px-0 order-subtotal-discount d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.SubTotalDiscount"]:</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{vmorder.totals.SubTotalDiscount}}</span>
            </td>
        </tr>
        <tr class="col-12 px-0 shipping-cost d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.Shipping"]:</span>
                <span v-if="vmorder.totals.RequiresShipping && vmorder.totals.SelectedShippingMethod !== null" class="selected-shipping-method">@Loc["ShoppingCart.Totals.Shipping.Method"].ToString().Replace("{0}", "{{vmorder.totals.SelectedShippingMethod}}")</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <div v-if="vmorder.totals.RequiresShipping">
                    <span v-if="vmorder.totals.Shipping !== null">
                        {{vmorder.totals.Shipping}}
                    </span>
                    <span v-else>
                        @Loc["ShoppingCart.Totals.CalculatedDuringCheckout"]
                    </span>
                </div>
                <div v-else>
                    <span>@Loc["ShoppingCart.Totals.Shipping.NotRequired"]</span>
                </div>
            </td>
        </tr>
        <tr v-if="vmorder.totals.PaymentMethodAdditionalFee !== null" class="col-12 px-0 additional-fees d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.PaymentMethodAdditionalFee"]:</span>
            </td>
            <td class="col-6 cart-total-right text-right">
                <span class="value-summary">{{vmorder.totals.PaymentMethodAdditionalFee}}</span>
            </td>
        </tr>

        <tr v-if="vmorder.totals.DisplayTaxRates && vmorder.totals.TaxRates[0]" v-for="taxRate in vmorder.totals.TaxRates" class="col-12 px-0 tax-rate d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>
                    @Loc["ShoppingCart.Totals.TaxRateLine"].ToString().Replace("{0}", "{{taxRate.Rate}}")
                </span>
            </td>
            <td class="col-6 cart-total-right text-right">
                <span>{{taxRate.Value}}</span>
            </td>
        </tr>
        <tr v-if="vmorder.totals.DisplayTax" class="col-12 px-0 tax-value d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.Tax"]:</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{vmorder.totals.Tax}}</span>
            </td>
        </tr>
        <tr v-if="vmorder.totals.OrderTotalDiscount !== null" class="col-12 px-0 discount-total d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.OrderTotalDiscount"]:</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{vmorder.totals.OrderTotalDiscount}}</span>
            </td>
        </tr>
        <tr v-for="gc in vmorder.totals.GiftVouchers" class="col-12 px-0 giftvoucher-summary d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.GiftVoucherInfo"]:</span>
                <span>@Loc["ShoppingCart.Totals.GiftVoucherInfo.Code"].ToString().Replace("{0}", "{{gc.CouponCode}}")</span>
                <span class="giftvoucher-remaining">@Loc["ShoppingCart.Totals.GiftVoucherInfo.Remaining"].ToString().Replace("{0}", "{{gc.Remaining}}")</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{gc.Amount}}</span>

                <b-button v-if="vmorder.cart.IsEditable" variant="danger" type="button" name="removegiftvoucher" id="remove-gift-card-button" @@click="vmorder.removeGiftVoucher('@Url.RouteUrl("RemoveGiftVoucherCode")?giftVoucherId=' + gc.Id)">
                    @Loc["Common.Remove"]
                </b-button>
            </td>
        </tr>
        <tr v-if="vmorder.totals.RedeemedLoyaltyPoints > 0" class="col-12 px-0 loyalty-points d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.LoyaltyPoints"].ToString().Replace("{0}", "{{vmorder.totals.RedeemedLoyaltyPoints}}")</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span class="value-summary">{{vmorder.totals.RedeemedLoyaltyPointsAmount}}</span>
            </td>
        </tr>
        <tr class="col-12 px-0 order-total d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.OrderTotal"]:</span>
            </td>
            <td class="col-6 cart-total-right  text-right">
                <span v-if="vmorder.totals.OrderTotal !== null" class="value-summary">
                    <strong>{{vmorder.totals.OrderTotal}}</strong>
                </span>
                <span v-else>@Loc["ShoppingCart.Totals.CalculatedDuringCheckout"]</span>
            </td>
        </tr>
        <tr v-if="vmorder.totals.WillEarnLoyaltyPoints > 0" class="col-12 px-0 earn-loyalty-points d-flex justify-content-start">
            <td class="col-6 cart-total-left">
                <span>@Loc["ShoppingCart.Totals.LoyaltyPoints.WillEarn"]:</span>
            </td>
            <td class="col-6 cart-total-right text-right">
                <span class="value-summary">@Loc["ShoppingCart.Totals.LoyaltyPoints.WillEarn.Point"].ToString().Replace("{0}", "{{vmorder.totals.WillEarnLoyaltyPoints}}")</span>
            </td>
        </tr>
        </tbody>
    </table>
</div>